package abacab.exec;

import abacab.queue.ActorQueue;
import abacab.queue.ActorQueueImpl;

import com.typesafe.config.Config;

/**
 * The factory for the default executor
 */
public class DefaultMessageExecutorFactory implements MessageExecutorFactory {
	@Override
	public MessageExecutor buildExecutor(Config config) {
		int maxExecutors = config.getInt("max-executors");
		int fairness = config.getInt("fairness");
		ActorQueue actorQueue = new ActorQueueImpl();
		return new DefaultMessageExecutor(maxExecutors, fairness, actorQueue);
	}
}